﻿@model IEnumerable<MIMSDomain.Entities.Patient>

@Scripts.Render("~/bundles/kendojs")
@Styles.Render("~/Content/kendocss")

<h1>Grid Data | Patients</h1>

<div id="Patients">
     @(Html.Telerik().Grid(Model)
     .DataKeys(keys => keys.Add(p => p.Id))
     .Name("Patients")
     .ToolBar(commands => commands.Custom().Text("Add New Patient").Action("AddPatient", "Patients"))
     .Columns(columns =>
         {
             columns.Command(command =>
                 {
                     command.Custom("Edit").Text("Edit").ButtonType(GridButtonType.ImageAndText)
                         .Action("EditPatient", "Patients");
                     command.Delete().ButtonType(GridButtonType.ImageAndText);
                     command.Custom("View").Text("View Details")                         
                         .Action("Patient", "Patients");
                 });
             columns.Bound(m => m.Code);
             columns.Bound(m => m.FirstName);
             columns.Bound(m => m.MiddleName);
             columns.Bound(m => m.LastName);
             columns.Bound(m => m.PatientType);
         })
     .Pageable(pageable => pageable.Enabled(true))
     .Editable(editing => editing.Enabled(false))
     .Filterable(filterable => filterable.Enabled(true))
     .Groupable(groupable => groupable.Enabled(true))
     .Footer(true))
</div>

                                                    